﻿#ifndef VERIFYDIALOG_H
#define VERIFYDIALOG_H

#include <QDialog>
#include <QSqlDatabase>
#include "ZKFingerReader/FingerprintReader.h"
#include "ZKFingerReader/FingerprintCacheDB.h"
#include "ZKFingerReader/FPCacheDBLoader.h"

namespace Ui {
class VerifyDialog;
}

class VerifyDialog : public QDialog
{
    Q_OBJECT

public:
    explicit VerifyDialog(QWidget *parent = 0);
    ~VerifyDialog();
private slots:
    void onLogin();
    void onCancel();
    void onUserIDChanged();
    void onFingerprintReceived(QImage image, QByteArray fpTemplate);
    void onFingerprintRejected();

private:
    Ui::VerifyDialog *ui;
    ZKFP::FingerprintReader m_reader;
    ZKFP::FingerprintCacheDB m_cacheDB;
    ZKFP::FPCacheDBLoader m_dbLoader;

    QString m_name;
    QString m_password;
    QByteArray m_regTemplate;
    bool m_fpOk;
    void initUserInfo();
};

#endif // VERIFYDIALOG_H
